<?php


function count_to_ten(){
    yield 1;
    yield 2;
    yield from [3,4];
    yield from new ArrayIterator([5,6]);
    yield from sevent_eight();
    yield 9;
    yield 10;
}

function sevent_eight(){
    yield 7;
    yield from eight();
}

function eight(){
    yield 8;
}

foreach(count_to_ten() as $num){
    echo "$num ";
}





















